package cn.edu.nyist.integration.controller;

import cn.edu.nyist.integration.common.ServerResponse;
import cn.edu.nyist.integration.entity.User;
import cn.edu.nyist.integration.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.thymeleaf.exceptions.TemplateInputException;


@Controller
@RequestMapping("/manager")
public class IndexController {
    @Autowired
    private UserService userService;

    @GetMapping("/index")
    public String userIndex(@RequestParam("id") Long id){
        if (id == null){
            /*登陆过期重新登录*/
            return "redirect:/user/";
        }
        if (id == 1){
            /*管理员*/
            return "page/admin";
        }
        /*普通用户*/
        return "page/index";

    }



}
